Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

185
Visualizações
Global "window" object

The global window object stores properties specific to the environment (for example, window.innerHeight).

But if we print window to the console, we will see the properties highlighted in a different color.

enter image description here

These include Array, Object, and so on, although i thought they are internal objects.

I have a few questions:

  1. What are these "implicit" properties?
  2. Where do JS boundaries end and environment begin?
  3. Can I refer to Array in Node.js, for example?

Thank you.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

In the early days of Javascript, there was one master global symbol and everything that was available in the global scope whether it was part of the language itself or part of the browser environment was a property of that master global.

In the browser, that master global is the window object. Thus, you see many things on the window object that are available globally like the Array constructor.

I would guess that this is a side effect of that fact that Javascript was first designed to run in a browser and was not initially a completely stand-alone language with a stand-alone specification.

More recent revisions to the language specification are not adding some new things to the window object any more. For example, when you declare an ES6 class such as:

class Foo {
    constructor(greeting) {
        this.greeting = greeting;
    }
}

You will not find Foo on the window object even though it may be globally available in the browser.

As others have said, the color difference in the debug output has to do with whether the symbols are enumerable or not which is a technical distinction on whether the property shows up in something like Object.keys() or a for/in loop. The property is still there and is accessible either way.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda